#include "htf_ms_inference_engine.h"
#include "../../utils/htf_logger.h"
#include <string.h>

int htf_ms_run_inference(htf_ms_model_t* model, const float* input, size_t in_sz,
                         float* output, size_t out_sz) {
    if (!model || !input || !output) return -1;

    for (size_t i = 0; i < out_sz; i++) {
        float sum = 0.0f;
        for (size_t j = 0; j < in_sz && j < model->weight_count; j++) {
            sum += input[j] * model->weights[(i * in_sz + j) % model->weight_count];
        }
        output[i] = sum * 0.001f;
    }
    return 0;
}